<?php
// $res = post('http://127.0.0.1:8080/eth/getUserAddress/1');
// var_dump($res);

// $res = post('http://127.0.0.1:8080/ethToken/extract', [
//   'amount' => 1,
//   'address' => '0x6d1056f53a24Ee9052898bCc30AbCc40166eebad',
//   'orderId' => '1553155999238122',
//   'contract_address' => '0x8ebdcf3d843e3a96137e84117c7989c883ce6127'
// ]);

$res = post('http://127.0.0.1:8080/eth/extract', [
  'amount' => 0.0001,
  'address' => '0xF02C7B189aDB95207AF90Fbd05347E1C58301Df8',
  'orderId' => '1553155999238122',
  'contract_address' => '0x8ebdcf3d843e3a96137e84117c7989c883ce6127'
]);


// $res = post('http://127.0.0.1:8080/eth/getAddressEthAmount/0x6d1056f53a24Ee9052898bCc30AbCc40166eebad',[]);


// $res = post('http://127.0.0.1:8080/eth/getTransactionReceipt/0xf83eb896c3311e72a6384566f56846d7e1dbe3792d3118c17e3128cf9bea7cf0');
var_dump($res);

function post($url,$post = []) {
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL,$url);
  curl_setopt($ch, CURLOPT_HEADER,0);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 );
  curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
  curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post) );
  $res = curl_exec($ch);
  curl_close($ch);
  return $res;
}
